﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Hx.ADSyncPlatform.Entity.Entities
{
    ///<summary>
    ///
    ///</summary>
    public partial class Plat_SysManager
    {
        public Plat_SysManager()
        {


        }

        [SugarColumn(IsPrimaryKey = true)]
        public Guid UserId { get; set; }


        [Required(AllowEmptyStrings = false, ErrorMessage = "用户名必填")]
        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:False
        /// </summary>           
        public string UserName { get; set; }

        //[MinLength(length: 6, ErrorMessage = "密码至少6位")]
        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string Password { get; set; }


        //[Required(AllowEmptyStrings = false, ErrorMessage = "显示名必填")]
        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string DisplayName { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string Company { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string Department { get; set; }


        //[EmailAddress(ErrorMessage = "邮箱地址不合法")]
        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string Mail { get; set; }



        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string TelephoneNumber { get; set; }


        [StringLength(maximumLength: 11, MinimumLength = 11, ErrorMessage = "手机号码为11位")]
        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string Mobile { get; set; }

        public bool IsEnable { get; set; }


        [SugarColumn(IsIgnore = true)]
        public List<Guid> RoleIds { get; set; }

        [SugarColumn(IsIgnore = true)]
        public List<string> RoleNames { get; set; }

        public Guid ObjectGuid { get; set; }

        public Plat_SysManager GetChangedCopy(Plat_SysManager newOne)
        {
            this.Mobile = newOne.Mobile;
            this.TelephoneNumber = newOne.TelephoneNumber;
            this.Department = newOne.Department;
            this.Company = newOne.Company;
            this.DisplayName = newOne.DisplayName;
            this.UserName = newOne.UserName;
            this.IsEnable = newOne.IsEnable;
            return this;

        }

    }
}
